package cn.ml.sboot11.entity;

import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

public class Student {

    private Integer id;

    private String name;

    private String gender;

    //将"yyyy-MM-dd HH:mm"字符串转换为Date类型
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date bornday;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender == null ? null : gender.trim();
    }

    public Date getBornday() {
        return bornday;
    }

    public void setBornday(Date bornday) {
        this.bornday = bornday;
    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                ", bornday=" + bornday +
                '}';
    }
}